<template>
    <div class="login">
        <div class="login-box">
             <div class="user-box">
                <input type="text" v-model="username" placeholder="user">
            </div>
            <div class="password-box">
                <input type="password" v-model="password" placeholder="password">
            </div>
            <div>
                <button @click="handleSubmitClick">登录</button>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'login',
    data () {
        return {
            username: '',
            password: ''
        }
    },
    methods: {
        handleSubmitClick () {
            if (this.username === 'test' && this.password === '123456') {
                this.$router.push('/entry')
            }
        }
    }
}
</script>

<style lang="less" scoped>
.login {
    width: 100%;
    height: 100vh;
    font-size: 0.2rem; 
    background: url(../assets/login.jpg) no-repeat;
    background-size: 100% 100%; 
    display: flex;
    display: -webkit-flex;
    .login-box {
        margin: 2.5rem auto;
        input {
            width: 60vw;
            height: 30px;
            border-radius: 5px;
            background: #fff!important;
            border: none;
            text-indent: 12px;
        }
        .password-box {
            margin: 10px 0;
        }
        button {
            width: 60vw;
            height: 30px;
            border-radius: 5px;
            background: #fff!important;
            border: none;
        }
    }
}
</style>